<?php 

add_custom_image_header('header_style', 'admin_header_style');

	// The default header text color
	define( 'HEADER_TEXTCOLOR', '000' );

	// By leaving empty, we allow for random image rotation.
	define( 'HEADER_IMAGE', '' );
	// Don't support text inside the header image.
    define( 'NO_HEADER_TEXT', true );

	// The height and width of your custom header.
	// Add a filter to twentyeleven_header_image_width and twentyeleven_header_image_height to change these values.
	define( 'HEADER_IMAGE_WIDTH', apply_filters( 'twentyeleven_header_image_width', 960 ) );
	define( 'HEADER_IMAGE_HEIGHT', apply_filters( 'twentyeleven_header_image_height', 340 ) );
	
// Turn on random header image rotation by default.
	add_theme_support( 'custom-header', array( 'random-default' => true ) );

     // Default custom headers packaged with the theme. %s is a placeholder for the theme template directory URI.
    register_default_headers( array (
    'sample1' => array (
    'url' => '%s/images/headers/sample1.jpg',
    'thumbnail_url' => '%s/images/headers/sample1-thumbnail.jpg',
    'description' => __( 'Sample 1', 'gp' )
    ),
    'sample2' => array (
    'url' => '%s/images/headers/sample2.jpg',
    'thumbnail_url' => '%s/images/headers/sample2-thumbnail.jpg',
    'description' => __( 'Sample 2', 'gp' )
    ),
    'sample3' => array (
    'url' => '%s/images/headers/sample3.jpg',
    'thumbnail_url' => '%s/images/headers/sample3-thumbnail.jpg',
    'description' => __( 'Sample 3', 'gp' )
    )
    ) );  
	
	// gets included in the site header
function header_style() {
    ?><style type="text/css">
        #header {
            background: url(<?php header_image(); ?>);
        }
    </style><?php
}
// gets included in the admin header
function admin_header_style() {
    ?><style type="text/css">
        #headimg {
            width: <?php echo HEADER_IMAGE_WIDTH; ?>px;
            height: <?php echo HEADER_IMAGE_HEIGHT; ?>px;
            background: no-repeat;
        }
    </style><?php
} 
?>